home *** CD-ROM | disk | FTP | other *** search
- on validatePDCScreen
- global calcdata
- set DDC to integer(field "calories")
- if DDC < 800 then
- setaProp(calcdata, #desired_calories, 800)
- put 800 into field "calories"
- lowhelp()
- return 0
- else
- if DDC > 5000 then
- put 5000 into field "calories"
- setaProp(calcdata, #desired_calories, 5000)
- highhelp()
- return 0
- else
- return 1
- end if
- end if
- set numMeals to integer(field "meals")
- if numMeals < 2 then
- put 2 into field "Meals"
- alert("Please enter either 2 or 3 for the number of meals. The value you entered has been changed to 2.")
- else
- if numMeals > 3 then
- put 3 into field "meals"
- alert("Please enter either 2 or 3 for the number of meals. the value you entered has been changed to 3.")
- end if
- end if
- end
-
- on PDCOK
- set OK to 1
- if (the frameLabel = "PDC") and not validatePDCScreen() then
- set OK to 0
- put "OK = " & OK
- end if
- return OK
- end
-